<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>05_DOM操作2</title>
</head>
<body>
<input type="text" id = "username">

<input type="text" id = "password">
<button onclick="f1()">注册</button>
<h3>震惊：<span class="span1"></span></h3>
<button onclick="f2()">点击</button>
<script>
    function f2(){
        let spanE = document.querySelector('.span1');
        spanE.innerHTML = '哈哈哈';
        spanE.innerHTML = '哈<mark>哈</mark>哈';
        spanE.innerHTML = '<table border="1"><tr><td>haha</td><td>didi</td><td>papa</td></tr></table>';
    }
    function f1(){
        let input1 = document.querySelector('#username');//根据id选择器获取元素
        let input2 = document.getElementById('password');//根据id值获取元素
        let i1 = parseFloat(input1.value);
        let i2 = parseFloat(input2.value);
        console.log(input1+input2);
        console.log(i1 , typeof i1);
        console.log(i2 , typeof i2);
        console.log(i1+i2);
    }
</script>

</body>
</html>